<?php

/**
 * Profile filter form base class.
 *
 * @package    Onnobostro
 * @subpackage filter
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormFilterGeneratedTemplate.php 24171 2009-11-19 16:37:50Z Kris.Wallsmith $
 */
abstract class BaseProfileFormFilter extends BaseFormFilterDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'user_id'            => new sfWidgetFormDoctrineChoice(array('model' => 'DmUser', 'add_empty' => true)),
      'title'              => new sfWidgetFormChoice(array('choices' => array('' => '', 'Mr' => 'Mr', 'Mss' => 'Mss'))),
      'first_name'         => new sfWidgetFormDmFilterInput(),
      'last_name'          => new sfWidgetFormDmFilterInput(),
      'nick_name'          => new sfWidgetFormDmFilterInput(),
      'company'            => new sfWidgetFormDmFilterInput(),
      'phone_no'           => new sfWidgetFormDmFilterInput(),
      'phone_no1'          => new sfWidgetFormDmFilterInput(),
      'land_phone_no'      => new sfWidgetFormDmFilterInput(),
      'fax'                => new sfWidgetFormDmFilterInput(),
      'street_address1'    => new sfWidgetFormDmFilterInput(),
      'street_address2'    => new sfWidgetFormDmFilterInput(),
      'city'               => new sfWidgetFormDmFilterInput(),
      'post_code'          => new sfWidgetFormDmFilterInput(),
      'state'              => new sfWidgetFormDmFilterInput(),
      'country'            => new sfWidgetFormDmFilterInput(),
      'message'            => new sfWidgetFormDmFilterInput(),
      'shipping_address1'  => new sfWidgetFormDmFilterInput(),
      'shipping_address2'  => new sfWidgetFormDmFilterInput(),
      'shipping_city'      => new sfWidgetFormDmFilterInput(),
      'shipping_post_code' => new sfWidgetFormDmFilterInput(),
      'shipping_country'   => new sfWidgetFormDmFilterInput(),
      'contact_person'     => new sfWidgetFormDmFilterInput(),
      'contact_phone'      => new sfWidgetFormDmFilterInput(),
      'delivery_time'      => new sfWidgetFormDmFilterInput(),
      'terms'              => new sfWidgetFormChoice(array('choices' => array('' => $this->getI18n()->__('yes or no', array(), 'dm'), 1 => $this->getI18n()->__('yes', array(), 'dm'), 0 => $this->getI18n()->__('no', array(), 'dm')))),
    ));

    $this->setValidators(array(
      'user_id'            => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('User'), 'column' => 'id')),
      'title'              => new sfValidatorChoice(array('required' => false, 'choices' => array('Mr' => 'Mr', 'Mss' => 'Mss'))),
      'first_name'         => new sfValidatorPass(array('required' => false)),
      'last_name'          => new sfValidatorPass(array('required' => false)),
      'nick_name'          => new sfValidatorPass(array('required' => false)),
      'company'            => new sfValidatorPass(array('required' => false)),
      'phone_no'           => new sfValidatorPass(array('required' => false)),
      'phone_no1'          => new sfValidatorPass(array('required' => false)),
      'land_phone_no'      => new sfValidatorPass(array('required' => false)),
      'fax'                => new sfValidatorPass(array('required' => false)),
      'street_address1'    => new sfValidatorPass(array('required' => false)),
      'street_address2'    => new sfValidatorPass(array('required' => false)),
      'city'               => new sfValidatorPass(array('required' => false)),
      'post_code'          => new sfValidatorPass(array('required' => false)),
      'state'              => new sfValidatorPass(array('required' => false)),
      'country'            => new sfValidatorPass(array('required' => false)),
      'message'            => new sfValidatorPass(array('required' => false)),
      'shipping_address1'  => new sfValidatorPass(array('required' => false)),
      'shipping_address2'  => new sfValidatorPass(array('required' => false)),
      'shipping_city'      => new sfValidatorPass(array('required' => false)),
      'shipping_post_code' => new sfValidatorPass(array('required' => false)),
      'shipping_country'   => new sfValidatorPass(array('required' => false)),
      'contact_person'     => new sfValidatorPass(array('required' => false)),
      'contact_phone'      => new sfValidatorPass(array('required' => false)),
      'delivery_time'      => new sfValidatorPass(array('required' => false)),
      'terms'              => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
    ));
    

    $this->widgetSchema->setNameFormat('profile_filters[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'Profile';
  }

  public function getFields()
  {
    return array(
      'id'                 => 'Number',
      'user_id'            => 'ForeignKey',
      'title'              => 'Enum',
      'first_name'         => 'Text',
      'last_name'          => 'Text',
      'nick_name'          => 'Text',
      'company'            => 'Text',
      'phone_no'           => 'Text',
      'phone_no1'          => 'Text',
      'land_phone_no'      => 'Text',
      'fax'                => 'Text',
      'street_address1'    => 'Text',
      'street_address2'    => 'Text',
      'city'               => 'Text',
      'post_code'          => 'Text',
      'state'              => 'Text',
      'country'            => 'Text',
      'message'            => 'Text',
      'shipping_address1'  => 'Text',
      'shipping_address2'  => 'Text',
      'shipping_city'      => 'Text',
      'shipping_post_code' => 'Text',
      'shipping_country'   => 'Text',
      'contact_person'     => 'Text',
      'contact_phone'      => 'Text',
      'delivery_time'      => 'Text',
      'terms'              => 'Boolean',
    );
  }
}
